clear
est clear


	use "$input/full_geoid_pair_panel.dta"
	
	bysort state_fips: egen max=max(storm)
		drop if max!=1

	replace migration=migration/(tot_pop/100000)
	
			
	
	duplicates drop from_geoid move_year, force
	
		collapse (sum) storm ,by(from_geoid gdp)
	
		
		
		egen mean_storm=mean(storm)
		egen sd_storm=sd(storm)
		egen mean_gdp=mean(gdp)
		egen sd_gdp=sd(gdp)
		g z_storm=(storm-mean_storm)/sd_storm
		g z_gdp=(gdp-mean_gdp)/sd_gdp
		
		g ln_gdp=ln(gdp)
		twoway (scatter storm ln_gdp ,m(C) mc(forest_green%10)) ///
						(lfit storm ln_gdp , lc(gs4) lp(dash) ///
						yti("Total storms", size(large)) xtitle("ln(2019 GDP)", size(large)) xlab(, nogrid labsize(vlarge)) ylabel(,nogrid labsize(vlarge)) ysize(12) xsize(12) legend(off))	
						
		graph export "$figures/fig_4b.png", as(png) replace
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			